package cn.lecosa.spark

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext

object Demo2 {
  def main(args: Array[String]): Unit = {
    //创建配置对象
    val conf = new SparkConf();
    //设定应用名称
    conf.setAppName("SparkDemo2")
    //设定mater地址
    conf.setMaster("spark://datanode02:7077")
    //基于conf创建出sc对象
    val sc = new SparkContext(conf);

    val rdd = sc.parallelize(List(("cat", 2), ("dog", 5), ("cat", 4), ("dog", 3), ("cat", 6), ("dog", 3), ("cat", 9), ("dog", 1)), 2);
  }
}